<template>
  <div id="app">
    <a-form-model
      :model="form"
      :label-col="labelCol"
      :wrapper-col="wrapperCol"
      @submit="handleSubmit"
    >
      <a-form-model-item label="姓名">
        <a-input v-model="form.name" />
      </a-form-model-item>
      <a-form-model-item label="手机号">
        <a-input v-model="form.mobile" />
      </a-form-model-item>
      <a-form-model-item label="邮箱">
        <ValidationProvider mode="lazy" rules="required|email">
          <div slot-scope="{ errors }">
            <a-input v-model="form.email" />
            <!-- <input v-model="value" type="text" /> -->
            <p v-for="error in errors">{{ error }}</p>
          </div>
        </ValidationProvider>
      </a-form-model-item>
      <a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
        <a-button type="primary" htmlType="submit">提交</a-button>
        <a-button style="margin-left: 10px;">Cancel</a-button>
      </a-form-model-item>
    </a-form-model>
    <!-- <a-input placeholder="Basic usage" /> -->
    <!-- <div id="nav">
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link>
    </div>
    <router-view/>-->
  </div>
</template>

<script>
export default {
  data() {
    return {
      labelCol: { span: 4 },
      wrapperCol: { span: 14 },
      form: {
        name: '',
        mobile: '',
        email: ''
      },
      value: ''
    }
  },
  methods: {
    handleSubmit() {
      console.log(1);
    }
  }
}
</script>>

<style lang="scss">
#app {
  padding: 15px;
  box-sizing: border-box;
}
// #app {
//   font-family: Avenir, Helvetica, Arial, sans-serif;
//   -webkit-font-smoothing: antialiased;
//   -moz-osx-font-smoothing: grayscale;
//   text-align: center;
//   color: #2c3e50;
// }

// #nav {
//   padding: 30px;

//   a {
//     font-weight: bold;
//     color: #2c3e50;

//     &.router-link-exact-active {
//       color: #42b983;
//     }
//   }
// }
</style>
